<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort();
System.out.println(basePath);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
<base href="<%=basePath%>">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>
		<s:if test="userDetial.username!=''">
<s:property value="userDetial.username"/>
</s:if>
<s:else>
<s:property value="userDetial.eusername"/>
</s:else>
友邻
		</title>
		<link href="css/style.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="js/tools/jquery-1.4.2.min.js"></script>
	</head>

	<body>
		<div class="container">
			<jsp:include page="../head.jsp"/> 
			<div class="ge"></div>
			<div class="content">
				<div class="wrapp">
<div class="album_left"> 
      <s:if test="users.level==2">
		<a href="user/user!singleUserPage.action?userId=<s:property value='users.id'/>&currentPage=1" >
		</s:if>
		<s:elseif test="users.level==3">
		<a href="user/user!groupbyUserPage.action?currentPage=1&userId=<s:property value='users.id'/>" >
		</s:elseif>
		<s:elseif test="users.level==4">
		<a href="user/user!brandUserPage.action?currentPage=1&userId=<s:property value='users.id'/>" target="_parent">
		</s:elseif>
                     <s:if test="userDetial.image.equals('')">
				          <img src="images/img.gif"  class="img4"  />
				      </s:if>
				      <s:else>
				         <img src="uploadFile/<s:property value="userDetial.image"/>" class="img4"  />
		              </s:else>
		              </a>
		 </div>
<div class="album_right">
<div class="album_ding"><a >

<s:if test="userDetial.username!=null && userDetial.username!=''">
			        <s:property value='userDetial.username'/>
				</s:if>
				<s:elseif test="userDetial.eusername!=null && !userDetial.eusername.equals('')">
				    <s:property value='userDetial.eusername'/>
				</s:elseif>
				<s:else>
				    <s:property value='users.email.substring(0,users.email.indexOf("@"))'/>
				</s:else>

的友邻</a></div>
<div class="album_di">
<s:if test="users.level==2">
<a href="user/user!singleUserPage.action?userId=<s:property value='users.id'/>&currentPage=1" >首页</a>&nbsp;&nbsp;
			<a href="user/user!dynamicList.action?currentPage=1&userId=<s:property value='users.id'/>" target="_parent">动态</a>&nbsp;&nbsp;
			<a href="user/user!brandUserList.action?currentPage=1&userId=<s:property value='users.id'/>" target="_parent">品牌</a>&nbsp;&nbsp;
			<a href="user/user!myFriendList.action?currentPage=1&userId=<s:property value="users.id"/>"  target="_parent">友邻</a>&nbsp;&nbsp;
			<a href="user/user!feedBack.action?currentPage=1&userId=<s:property value="users.id"/>" target="_parent">留言</a>
</s:if>
<s:elseif test="users.level==3">
<a href="user/user!groupbyUserPage.action?currentPage=1&userId=<s:property value='users.id'/>" >首页</a>&nbsp;&nbsp;
			 <a href="user/user!myGroupby.action?currentPage=1&userId=<s:property value='users.id'/>" target="_parent">团购</a>&nbsp;&nbsp;
			 <a href="user/user!myOldGroupby.action?currentPage=1&userId=<s:property value='users.id'/>" target="_parent">往期团购</a>&nbsp;&nbsp;
			 <a href="user/user!myFriendList.action?currentPage=1&userId=<s:property value="users.id"/>"  target="_parent">友邻</a>&nbsp;&nbsp;
			 <a href="user/user!myCriticism.action?currentPage=1&userId=<s:property value="users.id"/>"  target="_parent">评论</a>&nbsp;&nbsp;
</s:elseif>
<s:elseif test="users.level==4">
<a href="user/user!brandUserPage.action?currentPage=1&userId=<s:property value='users.id'/>" target="_parent">首页</a>&nbsp;&nbsp;
<a href="user/branduser!picturesList.action?currentPage=1&userId=<s:property value='users.id'/>" target="_parent">相册</a>&nbsp;&nbsp;
<a href="user/branduser!brandInforAllList.action?currentPage=1&userId=<s:property value="users.id"/>" target="_parent">资讯</a>&nbsp;&nbsp;
<a href="user/branduser!topicList.action?currentPage=1&userId=<s:property value="users.id"/>" target="_parent">论坛</a>&nbsp;&nbsp;
<a href="user/user!myFriendList.action?currentPage=1&userId=<s:property value="users.id"/>" target="_parent">友邻</a>&nbsp;&nbsp;
<a href="user/user!myCriticism.action?currentPage=1&userId=<s:property value="users.id"/>" target="_parent">评论</a>
</s:elseif>

</div>
</div>
<div class="clear"></div>
</div>
					
				<div class="wrap">
					<div class="left">
						<div class="box_friend">
							<div class="box_friend_top">
								<a  target="_parent">我的朋友</a>
							</div>
							<div class="box_friend_con">
								<div class="hh2">
									<s:iterator value="myFriendList" id="id" status="status">
									        <s:if test="#id[0].level==2">
						                      <s:set name="url">user/user!singleUserPage.action?currentPage=1&userId=<s:property value="#id[0].id"/></s:set>
										 
										   
										<div class="boxf" style="height:82px;">
											<div class="boxf_top">
												<a href="<s:property value="url"/>" target="_parent">
												   <s:if test="#id[1].image.equals('')">
														<img src="uploadFile/img.gif" width=60 height=60 />
													</s:if> 
													<s:else>
														<img src="uploadFile/<s:property value="#id[1].image"/>" width=60 height=60 />
													</s:else> 
													</a>
											</div>
											<div class="boxf_bot">
												<a href="<s:property value="url"/>" target="_parent"><s:property value="#id[1].username" />
												</a>
											</div>
										</div>
										  </s:if>
									</s:iterator>
								</div>
							</div>

							<!--end 我关注的品牌--->
							<div class="clear"></div>
							<div class="ye">
							<s:if test="#request.myFriendList.size()!=0">
							      <s:set name="pageUrl" >user/user!myFriendList.action?userId=${userId}&currentPage=</s:set>
							      <a href="${pageUrl}1">第一页</a>&nbsp;&nbsp;<a href="${pageUrl}<s:property value="#request.pages.prePage"/>">上一页</a>&nbsp;&nbsp;
							      <s:set name="totalPage" value="#request.pages.totalPage"></s:set>
							      <s:set name="currentPage" value="#request.pages.currentPage"></s:set>
							   <s:if test="#currentPage<=0">
							      <s:set name="currentPage" value="1"></s:set>
							   </s:if>
							   <s:elseif test="#currentPage>#totalPage">
							      <s:set name="currentPage" value="#totalPage"></s:set>
							   </s:elseif>
							   
							   <s:if test="#totalPage%6>0">
							       <s:set name="pageSize" value="#totalPage/6+1"></s:set>
							   </s:if>
							   <s:else>
							       <s:set name="pageSize" value="#totalPage/6"></s:set>
							   </s:else>
							  
							   
							   <s:if test="#currentPage%6>0">
							       <s:set name="cPageSize" value="#currentPage/6+1"></s:set>
							   </s:if>
							   <s:else>
							       <s:set name="cPageSize" value="#currentPage/6"></s:set>
							   </s:else>
							   
							   <s:set name="first" value="6*(#cPageSize-1)"></s:set>
							   <s:if test="#first==0">
							      <s:set name="first" value="1"></s:set>
							   </s:if>
							   <s:set name="last" value="#cPageSize*6"></s:set>
							   <s:if test="#last>#totalPage">
							      <s:set name="last" value="#totalPage"></s:set>
							   </s:if>
				
							     <s:bean name="org.apache.struts2.util.Counter" id="counter"> 
							       <s:param name="first" value="#first"/>
							       <s:param name="last" value="#last" />
							       <s:iterator status="status"> 
							         <s:if test="#currentPage==(#status.index+#first)">
							            &nbsp;&nbsp;<s:a href="%{pageUrl}%{#status.index+#first}" cssStyle="background-color:#982987;color:#FFFFFF; padding-right:3px; padding-left:3px;" ><s:property value="#status.index+#first" /></s:a>
							         </s:if>
							         <s:else>
							            &nbsp;&nbsp;<s:a href="%{pageUrl}%{#status.index+#first}" ><s:property value="#status.index+#first" /></s:a>
							         </s:else>
							       </s:iterator> 
							     </s:bean>
							     <s:if test="#last<#totalPage">
							       ......&nbsp;
							     </s:if>
		                       <a href="${pageUrl}<s:property value="#request.pages.nextPage"/>">下一页</a>&nbsp;&nbsp;<a href="${pageUrl}<s:property value="#request.pages.totalPage"/>">最后一页</a>
		             </s:if> 
							</div>

						</div>

					</div>
					<div class="clear"></div>
				</div>
			</div>
			<div id="foot">
				<jsp:include page="../bot.jsp"></jsp:include>
			</div>


		</div>
	</body>
</html>
